{% extends "photologue/root.html" %}

{% block title %}Latest Photo Galleries{% endblock %}

{% block body_id %}latest_galleries{% endblock %}

{% block content %}

<h1>Latest Photo Galleries</h1>

{% if latest %}
    {% for gallery in latest %}
    <div class="photo-gallery">
        <h2><a href="{{ gallery.get_absolute_url }}">{{ gallery.title }}</a></h2>
        {% for photo in gallery.sample|slice:sample_size %}
        <div class="gallery-photo">
            <a href="{{ photo.get_absolute_url }}"><img src="{{ photo.medium.url }}" alt="{{ photo.title }}"/></a>
        </div>
        {% endfor %}
    </div>
    <br class="clear" />
    {% endfor %}
{% else %}
    <p>No galleries were found.</p>
{% endif %}

<br class="clear" />
<p><a href="{% url pl-gallery-list 1 %}">View all galleries.</a></p>

{% endblock %}
